﻿using Abp.Application.Features;
using Abp.Localization;
using Abp.UI.Inputs;
using System;
using System.Collections.Generic;
using System.Text;

namespace Partner.Surround.Features
{
    /// <summary>
    /// 功能设置提供器
    /// </summary>
    public class AppFeatureProvider : FeatureProvider
    {
        public override void SetFeatures(IFeatureDefinitionContext context)
        {
            var hostSettings = context.Create(
                AppFeatures.HostSettings,
                defaultValue: "false",
                displayName: L("HostSettings"),
                inputType: new CheckboxInputType()
            );

            var customerService = context.Create(
                AppFeatures.CustomerService,
                defaultValue: "false",
                displayName: L("CustomerService"),
                inputType: new CheckboxInputType()
            );

            var customerServiceMaps = customerService.CreateChildFeature(
                AppFeatures.CustomerService_Maps,
                defaultValue: "false",
                displayName: L("CustomerServiceMaps"),
                inputType: new CheckboxInputType()
            );
        }

        private ILocalizableString L(string name)
        {
            return new LocalizableString(name, SurroundConsts.LocalizationSourceName);
        }
    }
}
